home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / lmitool / fullstate.sci < prev    next >
Text File  |  1999-09-16  |  1KB  |  35 lines

  1.  function [X,Y,gama]=fullstate(A,B1,B2,C1,D12,D11)
  2.  // Generated by lmitool on Thu Feb 09 11:30:44 MET 1995
  3.    
  4.    Mbound = 1e3;
  5.    abstol = 1e-10;
  6.    nu = 10;
  7.    maxiters = 100;
  8.    reltol = 1e-10;
  9.    options=[Mbound,abstol,nu,maxiters,reltol];
  10.     
  11.  ///////////DEFINE INITIAL GUESS AND PRELIMINARY CALCULATIONS BELOW
  12.  X_init=eye(A)                                                     
  13.  Y_init=zeros(B2');                                                
  14.  gama_init=1                                                       
  15.  I1=eye(B1'*B1);I2=eye(C1*C1');                                    
  16.  /////////// 
  17.   
  18.  XLIST0=list(X_init,Y_init,gama_init)
  19.  XLIST=lmisolver(XLIST0,fullstate_eval,options)
  20.  [X,Y,gama]=XLIST(:)
  21.   
  22.   
  23.   
  24.  /////////////////EVALUATION FUNCTION////////////////////////////
  25.   
  26.  function [LME,LMI,OBJ]=fullstate_eval(XLIST)
  27.  [X,Y,gama]=XLIST(:)
  28.   
  29.  /////////////////DEFINE LME, LMI and OBJ BELOW
  30.  LME=X-X' ;                                                        
  31.  LMI=-[A*X+X*A'+B2*Y+Y'*B2',B1,X*C1'+Y'*D12';                      
  32.  B1',-gama*I1,D11';                                                
  33.  C1*X+D12*Y,D11,-gama*I2]                                          
  34.  OBJ=gama                                                          
  35.